package com.mmd.bean;

import java.io.Serializable;
import java.util.UUID;

/**
 * @Author cyq
 * @Date 2019/8/21 22:23
 * @Description
 **/

public class WebJsonBean implements Serializable {
    private static final long serialVersionUID = 1L;
    private int code;
    private String desc;
    private String tid = UUID.randomUUID().toString();
    private Object data;

    public WebJsonBean() {
    }

    public WebJsonBean(CODE code) {
        this.code = code.getIndex();
        this.desc = code.getMsg();
    }

    public WebJsonBean(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public WebJsonBean(int code, String desc, Object data) {
        this.code = code;
        this.desc = desc;
        this.data = data;
    }

    public WebJsonBean(CODE code, Object data) {
        this.code = code.getIndex();
        this.desc = code.getMsg();
        this.data = data;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return this.desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getTid() {
        return this.tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public Object getData() {
        return this.data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
